import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Code9_10 {
    public static int myFine(int[] arr,int x){





    }
        //冒泡排序
/*        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length-i-1; j++) {
                if(arr[j] > arr[j+1]){
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                }
            }
        }
        //查找
        int left = 0;
        int right = arr.length-1;
        int mind = 0;
        while(left < right){
            mind = (left+right)/2;
            if(x > arr[mind]){
                left = mind + 1;
            }else if(x < arr[mind]){
                right = mind - 1;
            }else {
                return mind;
            }
        }
        return -2;
    }
    //二分查找
    public static void main(String[] args){
        int[] arr = {9,8,7,6,5,4,3,2};
        //myFine(arr,8);
         int ret = myFine(arr,11);
        System.out.println(ret+1);
    }*/
//在数组中查找特定的数字

/*
    public static void myFine(int[] arr){
        int sign = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if(input == arr[i]){
                sign = 1;
                System.out.println("找到了：下标为"+(i+1));
                break;
            }
        }
        if(sign == 0){
            System.out.println("找不到该元素");
        }
    }
    public static void main(String[] args) {
        int[] arr = {88,22,33,46,58};
        myFine(arr);
    }
*/

/*    private static void myFine(int[] arr){
        System.out.println("请输入要查找的元素：");
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == input) {
                System.out.println("找到了：" + (i + 1));
                return;
            }
        }
        //System.out.println("找不到该元素");

        }

    }
    public static void main(String[] args) {
        //查找数组中的指定元素
        int[] arr = new int[]{1,2,3,4,5};
        myFine(arr);
    }*/
/*
    private static double myAver(int[] arr){
        double sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum/(arr.length);
    }
    //求数组中的平均数
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,11};
        double ret = myAver(arr);
        System.out.println(ret);
    }
*/

/*        public static int[] myCopy(int[] arr1){
        //int[] arr3 = new int[arr1.length-1];
            int[] arr2 = new int[arr1.length];
        for (int i = 0; i < arr1.length; i++) {
            arr2[i] = arr1[i];
        }
        return arr2;

    }
    public static void main(String[] args) {
        //数组的拷贝
        int[] arr1 = new int[]{1,2,3,4};
        int[] arr2 = myCopy(arr1);
        int[] arr3 = Arrays.copyOf(arr1,arr1.length);

       *//* for (int i = 0; i < arr1.length; i++) {
                arr2[i] = arr1[i];
        }*//*
        System.out.println(Arrays.toString(arr2));
        System.out.println(Arrays.toString(arr3));

    }*/

/*    public static String myTostring(int[] array){
        String ret = "[ ";
        for (int i = 0; i < array.length; i++) {
            ret = ret + array[i]  + " ";
        }
        ret = ret + "]";
        return ret;

    }
    public static void main(String[] args) {
        //数组转字符串
        int [] array = new int[]{1,2,3,4};
        String str1 = myTostring(array);
        System.out.println(str1);
        String str2 = Arrays.toString(array);
        System.out.println(str2);
    }*/
}
